<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>tree_node - ClueLib</title><link rel="stylesheet" type="text/css" href="../styles/main.css"><script language=JavaScript src="../javascript/main.js"></script><script language=JavaScript src="../javascript/prettify.js"></script></head><body class="FramedContentPage" onLoad="NDOnLoad();prettyPrint();"><script language=JavaScript><!--
if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script>

<!--  Generated by Natural Docs, version 1.52 -->
<!--  http://www.naturaldocs.org  -->

<!-- saved from url=(0026)http://www.naturaldocs.org -->




<div id=Content><div class="CClass"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="tree_node"></a>tree_node</h1><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>class tree_node #(</td><td class="PType  prettyprint " nowrap>type&nbsp;</td><td class="PParameter  prettyprint " nowrap>T</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> int</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Implements a node of a <a href="cl_tree-svh.html#tree" class=LClass id=link16 onMouseOver="ShowTip(event, 'tt2', 'link16')" onMouseOut="HideTip('tt2')">tree</a>.</p><h4 class=CHeading>Parameter</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>T</td><td class=CDLDescription><span class="optional">optional</span> The type of data collected in a tree_node.&nbsp; The default is <b>int</b>.</td></tr></table><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SMain"><td class=SEntry><a href="#tree_node" id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">tree_node</a></td><td class=SDescription>Implements a node of a <a href="cl_tree-svh.html#tree" class=LClass id=link2 onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')">tree</a>.</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#tree_node.Types" >Types</a></td><td class=SDescription></td></tr><tr class="SType SIndent2 SMarked"><td class=SEntry><a href="#tree_node.tree_node_type" id=link3 onMouseOver="ShowTip(event, 'tt3', 'link3')" onMouseOut="HideTip('tt3')">tree_node_type</a></td><td class=SDescription>The shorthand of the tree node type specialized with type <b>T</b>.</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#tree_node.Properties" >Properties</a></td><td class=SDescription></td></tr><tr class="SProperty SIndent2 SMarked"><td class=SEntry><a href="#tree_node.elem" id=link4 onMouseOver="ShowTip(event, 'tt4', 'link4')" onMouseOut="HideTip('tt4')">elem</a></td><td class=SDescription>The element stored at this tree node.</td></tr><tr class="SProperty SIndent2"><td class=SEntry><a href="#tree_node.parent" id=link5 onMouseOver="ShowTip(event, 'tt5', 'link5')" onMouseOut="HideTip('tt5')">parent</a></td><td class=SDescription>The parent node of this tree node.</td></tr><tr class="SProperty SIndent2 SMarked"><td class=SEntry><a href="#tree_node.children" id=link6 onMouseOver="ShowTip(event, 'tt6', 'link6')" onMouseOut="HideTip('tt6')">children</a></td><td class=SDescription>The child nodes this tree node has.</td></tr><tr class="SProperty SIndent2"><td class=SEntry><a href="#tree_node.relatives" id=link7 onMouseOver="ShowTip(event, 'tt7', 'link7')" onMouseOut="HideTip('tt7')">relatives</a></td><td class=SDescription>The tree nodes this tree node is related to. </td></tr><tr class="SProperty SIndent2 SMarked"><td class=SEntry><a href="#tree_node.location" id=link8 onMouseOver="ShowTip(event, 'tt8', 'link8')" onMouseOut="HideTip('tt8')">location</a></td><td class=SDescription>The queue indicating the location of this tree node in a <a href="cl_tree-svh.html#tree" class=LClass id=link9 onMouseOver="ShowTip(event, 'tt2', 'link9')" onMouseOut="HideTip('tt2')">tree</a>. </td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#tree_node.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#tree_node.new" id=link10 onMouseOver="ShowTip(event, 'tt9', 'link10')" onMouseOut="HideTip('tt9')">new</a></td><td class=SDescription>Creates a new tree node.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#tree_node.add" id=link11 onMouseOver="ShowTip(event, 'tt10', 'link11')" onMouseOut="HideTip('tt10')">add</a></td><td class=SDescription><span class="virtual">virtual</span> Creates a tree node of the given element and adds it as a new child.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#tree_node.graft" id=link12 onMouseOver="ShowTip(event, 'tt11', 'link12')" onMouseOut="HideTip('tt11')">graft</a></td><td class=SDescription><span class="virtual">virtual</span> Grafts the given tree node (and its children) as a new child.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#tree_node.prune" id=link13 onMouseOver="ShowTip(event, 'tt12', 'link13')" onMouseOut="HideTip('tt12')">prune</a></td><td class=SDescription><span class="virtual">virtual</span> Removes the specified child (and its descendants).</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#tree_node.get_num_children" id=link14 onMouseOver="ShowTip(event, 'tt13', 'link14')" onMouseOut="HideTip('tt13')">get_num_children</a></td><td class=SDescription><span class="virtual">virtual</span> Returns the number of (immediate) children of this tree node. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#tree_node.has_child" id=link15 onMouseOver="ShowTip(event, 'tt14', 'link15')" onMouseOut="HideTip('tt14')">has_child</a></td><td class=SDescription><span class="virtual">virtual</span> Returns if this tree node has at least one child.</td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="tree_node.Types"></a>Types</h3></div></div>

<div class="CType"><div class=CTopic><h3 class=CTitle><a name="tree_node.tree_node_type"></a>tree_node_type</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>typedef tree_node#(</td><td class="PParameter  prettyprint " nowrap>T</td><td class="PAfterParameters  prettyprint "nowrap>) tree_node_type</td></tr></table></td></tr></table></blockquote><p>The shorthand of the tree node type specialized with type <b>T</b>.</p></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="tree_node.Properties"></a>Properties</h3></div></div>

<div class="CProperty"><div class=CTopic><h3 class=CTitle><a name="tree_node.elem"></a>elem</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">T elem</td></tr></table></blockquote><p>The element stored at this tree node.</p></div></div></div>

<div class="CProperty"><div class=CTopic><h3 class=CTitle><a name="tree_node.parent"></a>parent</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">tree_node_type parent</td></tr></table></blockquote><p>The parent node of this tree node.</p></div></div></div>

<div class="CProperty"><div class=CTopic><h3 class=CTitle><a name="tree_node.children"></a>children</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">tree_node_type children[$]</td></tr></table></blockquote><p>The child nodes this tree node has.</p></div></div></div>

<div class="CProperty"><div class=CTopic><h3 class=CTitle><a name="tree_node.relatives"></a>relatives</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">tree_node_type relatives[$]</td></tr></table></blockquote><p>The tree nodes this tree node is related to.&nbsp; Usage of this property is up to the user.</p></div></div></div>

<div class="CProperty"><div class=CTopic><h3 class=CTitle><a name="tree_node.location"></a>location</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">int location[$]</td></tr></table></blockquote><p>The queue indicating the location of this tree node in a <a href="cl_tree-svh.html#tree" class=LClass id=link17 onMouseOver="ShowTip(event, 'tt2', 'link17')" onMouseOut="HideTip('tt2')">tree</a>.&nbsp; Every child appends its index to the queue.&nbsp; <u>The <a href="#tree_node.new" class=LFunction id=link18 onMouseOver="ShowTip(event, 'tt9', 'link18')" onMouseOut="HideTip('tt9')">new</a>, <a href="#tree_node.add" class=LFunction id=link19 onMouseOver="ShowTip(event, 'tt10', 'link19')" onMouseOut="HideTip('tt10')">add</a>, <a href="#tree_node.graft" class=LFunction id=link20 onMouseOver="ShowTip(event, 'tt11', 'link20')" onMouseOut="HideTip('tt11')">graft</a>, and <a href="#tree_node.prune" class=LFunction id=link21 onMouseOver="ShowTip(event, 'tt12', 'link21')" onMouseOut="HideTip('tt12')">prune</a> functions do not update the location automatically.&nbsp; You must call <a href="cl_tree-svh.html#tree.update_locations" class=LFunction id=link22 onMouseOver="ShowTip(event, 'tt15', 'link22')" onMouseOut="HideTip('tt15')">tree::update_locations</a> to update the entire tree-node locations.</u>&nbsp; To get a human-readable location string, use <a href="cl_tree-svh.html#tree.get_location_name" class=LFunction id=link23 onMouseOver="ShowTip(event, 'tt16', 'link23')" onMouseOut="HideTip('tt16')">tree::get_location_name</a>.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">[0] -+-- [0,0] -+-- [0,0,0] ---- [0,0,0,0]
root |          |
node |          +-- [0,0,1]
     |
     +-- [0,1] -+-- [0,1,0] ---- [0,1,0,0]
     |          |
     |          +-- [0,1,1] -+-- [0,1,1,0]
     |                       |
     |                       +-- [0,1,1,1]
     |                       |
     |                       +-- [0,1,1,2]
     +-- [0,2]</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="cl_tree-svh.html#tree.get_location_name" class=LFunction id=link24 onMouseOver="ShowTip(event, 'tt16', 'link24')" onMouseOut="HideTip('tt16')">tree::get_location_name</a></p></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="tree_node.Functions"></a>Functions</h3></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="tree_node.new"></a>new</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>function new(</td><td class="PType  prettyprint " nowrap>T&nbsp;</td><td class="PParameter  prettyprint " nowrap>elem</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Creates a new tree node.</p><h4 class=CHeading>Argument</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>elem</td><td class=CDLDescription>Data element stored at the tree node.</td></tr></table><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">int i = 123;
tree_node#(int) tn = new( i );</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="tree_node.add"></a>add</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function tree_node_type add(</td><td class="PType  prettyprint " nowrap>T&nbsp;</td><td class="PParameter  prettyprint " nowrap>e</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="virtual">virtual</span> Creates a tree node of the given element and adds it as a new child.</p><h4 class=CHeading>Argument</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>e</td><td class=CDLDescription>An element to be added.</td></tr></table><h4 class=CHeading>Returns</h4><p>Newly added tree node.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">tree_node#(int) tn;
tree_node#(int) tn_123 = new( 123 );

tn = tn_123.add( 234 );
// (123) ---- (234) &lt;~~ tn

tn = tn_123.add( 345 );
// (123) -+-- (234)
//        |
//        +-- (345) &lt;~~ tn

tn = tn_123.add( 456 ).add( 567 ); // chain
// (123) -+-- (234)
//        |
//        +-- (345)
//        |
//        +-- (456) ---- (567) &lt;~~ tn</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="tree_node.graft"></a>graft</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function tree_node_type graft(</td><td class="PType  prettyprint " nowrap>tree_node_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>tn</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="virtual">virtual</span> Grafts the given tree node (and its children) as a new child.</p><h4 class=CHeading>Argument</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>tn</td><td class=CDLDescription>A tree node to be grafted.</td></tr></table><h4 class=CHeading>Returns</h4><p>A tree node to be grafted (<b>tn</b>).</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">tree_node#(int) tn_123;
tree_node#(int) tn_234;
tree_node#(int) tn_345;
tree_node#(int) tn_456;
tree_node#(int) tn;

tn_123 = new( 123 );
tn_234 = tn_123.add( 234 );
// (123) --- (234)
//             \__ tn_234

tn_345 = new( 345 );
tn_456 = tn_345.add( 456 );
// (345) ---- (456)
//   \__ tn_345

tn = tn_234.graft( tn_345 );
// (123) ---- (234) --- (345) ---- (456)
//                        \__ tn</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="tree_node.prune"></a>prune</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function tree_node_type prune(</td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>index</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="virtual">virtual</span> Removes the specified child (and its descendants).</p><h4 class=CHeading>Argument</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>index</td><td class=CDLDescription><span class="optional">optional</span> The index of the child.&nbsp; The default is <b>0</b>.&nbsp; If the specified child does not exist, this function does nothing.</td></tr></table><h4 class=CHeading>Returns</h4><p>This tree node.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">tree_node#(int) tn;
tree_node#(int) tn_123 = new( 123 );

tn = tn_123.add( 234 );
tn = tn_123.add( 456 ).add( 567 );
tn = tn_123.add( 345 );
// (123) -+-- (234)
//        |
//        +-- (456) ---- (567)
//        |
//        +-- (345)

tn = tn_123.prune( .index( 1 ) );
// (123) -+-- (234)
//        |
//        +-- (345)</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="tree_node.get_num_children"></a>get_num_children</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">virtual function int get_num_children()</td></tr></table></blockquote><p><span class="virtual">virtual</span> Returns the number of (immediate) children of this tree node.&nbsp; This function <u>does not</u> count the number of descendants recursively.</p><h4 class=CHeading>Returns</h4><p>The number of children.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">tree_node#(int) tn;
tree_node#(int) tn_123 = new( 123 );

tn = tn_123.add( 234 );
tn = tn_123.add( 345 );
tn = tn_123.add( 456 ).add( 567 );
// (123) -+-- (234)
//        |
//        +-- (345)
//        |
//        +-- (456) ---- (567)

assert( tn_123.get_num_children() == 3 ); // not 4</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="tree_node.has_child"></a>has_child</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">virtual function bit has_child()</td></tr></table></blockquote><p><span class="virtual">virtual</span> Returns if this tree node has at least one child.</p><h4 class=CHeading>Returns</h4><p>If this tree node has a child (or children), returns 1.&nbsp; Otherwise, returns 0.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">tree_node#(int) tn;
tree_node#(int) tn_123 = new( 123 );

tn = tn_123.add( 234 );
tn = tn_123.add( 345 );
tn = tn_123.add( 456 ).add( 567 );
// (123) -+-- (234)
//        |
//        +-- (345)
//        |
//        +-- (456) ---- (567)

assert( tn_123.has_child() == 1 );</pre></blockquote></div></div></div>

</div><!--Content-->



<!--START_ND_TOOLTIPS-->
<div class=CToolTip id="tt1"><div class=CClass><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>class tree_node #(</td><td class="PType  prettyprint " nowrap>type&nbsp;</td><td class="PParameter  prettyprint " nowrap>T</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> int</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Implements a node of a tree.</div></div><div class=CToolTip id="tt2"><div class=CClass><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>class tree #(</td><td class="PType  prettyprint " nowrap>type&nbsp;</td><td class="PParameter  prettyprint " nowrap>T</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> int</td><td class="PAfterParameters  prettyprint "nowrap>) extends collection#( T )</td></tr></table></td></tr></table></blockquote>Implements a tree structure.</div></div><div class=CToolTip id="tt3"><div class=CType><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>typedef tree_node#(</td><td class="PParameter  prettyprint " nowrap>T</td><td class="PAfterParameters  prettyprint "nowrap>) tree_node_type</td></tr></table></td></tr></table></blockquote>The shorthand of the tree node type specialized with type <b>T</b>.</div></div><div class=CToolTip id="tt4"><div class=CProperty><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">T elem</td></tr></table></blockquote>The element stored at this tree node.</div></div><div class=CToolTip id="tt5"><div class=CProperty><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">tree_node_type parent</td></tr></table></blockquote>The parent node of this tree node.</div></div><div class=CToolTip id="tt6"><div class=CProperty><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">tree_node_type children[$]</td></tr></table></blockquote>The child nodes this tree node has.</div></div><div class=CToolTip id="tt7"><div class=CProperty><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">tree_node_type relatives[$]</td></tr></table></blockquote>The tree nodes this tree node is related to. </div></div><div class=CToolTip id="tt8"><div class=CProperty><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">int location[$]</td></tr></table></blockquote>The queue indicating the location of this tree node in a tree. </div></div><div class=CToolTip id="tt9"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>function new(</td><td class="PType  prettyprint " nowrap>T&nbsp;</td><td class="PParameter  prettyprint " nowrap>elem</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Creates a new tree node.</div></div><div class=CToolTip id="tt10"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function tree_node_type add(</td><td class="PType  prettyprint " nowrap>T&nbsp;</td><td class="PParameter  prettyprint " nowrap>e</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="virtual">virtual</span> Creates a tree node of the given element and adds it as a new child.</div></div><div class=CToolTip id="tt11"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function tree_node_type graft(</td><td class="PType  prettyprint " nowrap>tree_node_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>tn</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="virtual">virtual</span> Grafts the given tree node (and its children) as a new child.</div></div><div class=CToolTip id="tt12"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function tree_node_type prune(</td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>index</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="virtual">virtual</span> Removes the specified child (and its descendants).</div></div><div class=CToolTip id="tt13"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">virtual function int get_num_children()</td></tr></table></blockquote><span class="virtual">virtual</span> Returns the number of (immediate) children of this tree node. </div></div><div class=CToolTip id="tt14"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">virtual function bit has_child()</td></tr></table></blockquote><span class="virtual">virtual</span> Returns if this tree node has at least one child.</div></div><div class=CToolTip id="tt15"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">virtual function void update_locations()</td></tr></table></blockquote><span class="virtual">virtual</span> Updates the tree_node::location of the entire tree.</div></div><div class=CToolTip id="tt16"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function string get_location_name(</td><td class="PType  prettyprint " nowrap>tree_node_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>tn</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="virtual">virtual</span> Returns the human-readable location string of this node from the root. </div></div><!--END_ND_TOOLTIPS-->

<script language=JavaScript><!--
if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html>